package algorithm

import (
	"com/study/util"
	"time"
)

// 判断是否为素数
func IsPrime(num int) bool {
	for i := 2; i < num; i++ {
		if num%i == 0 {
			return false
		}
	}
	return true
}

func FindPrimeLeNum(num int) {
	start := time.Now().Unix()
	primes := make([]int, 0)
	for i := 1; i < num; i++ {
		if IsPrime(i) {
			primes = append(primes, i)
		}
	}
	util.PrnType(primes)
	end := time.Now().Unix()
	println(end - start)
}
